<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="t"></div>
<input type="text" id="text" value=""/>
<input type="button" id="s"  value="write" onclick="test()"/>
</body>
    <script>
        function test() {
            var str = document.getElementById("text").value;
            document.getElementById("t").innerHTML = "<a href='"+str+"'>testLink</a>";
        }
        function ppp() {
            alert('papapa')
        }
    </script>
</html>